UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ugBIYlsZnzpJRp3tkOAqnG06n4n6R2hhHxmwME+wJY=' 
WHERE 
  key_id = 'e14f1e43f85c3adadb264124dce7725a4fc1aa64f38dd916aca695118b813489' 
  AND (
    token = '0ugBIYlsZnzpJRp3tkOAqnG06n4n6R2hhHxmwME+wJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027