UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6a+bGbS4eCl3zuffRP9AeW8IAJvnAuadf3kKmMMSazo=' 
WHERE 
  key_id = '045e7e82fcf1c42a160bf719da735206b13b3461417603bc0ad3db560641b66e' 
  AND (
    token = '6a+bGbS4eCl3zuffRP9AeW8IAJvnAuadf3kKmMMSazo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025