UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TQcyLWKR/EEx0F9fzwGgP2uHq3vbgFV0m9ID8qZ60Us=' 
WHERE 
  key_id = '43da4053e5fe1e599578873f8414ed1fe3f661538e9dc3cecfb92a3cfc3f81fb' 
  AND (
    token = 'TQcyLWKR/EEx0F9fzwGgP2uHq3vbgFV0m9ID8qZ60Us=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038