UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NbM/GfvyTK+U+uS605tbmWU4xQiOHAUuZVwUHqoapT8=' 
WHERE 
  key_id = '13f23352c475dff10858e05a7cfabeaca5970713afc4293b455757c83e5927dc' 
  AND (
    token = 'NbM/GfvyTK+U+uS605tbmWU4xQiOHAUuZVwUHqoapT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027