UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hNmgqlHLi5c3z5Ia09+UYgN69QzwnWZwLtTstQclHjw=' 
WHERE 
  key_id = 'd1aa82097fdb70d8ad4b678307eecf11a83c23112f1e779485ebf112db1fd73d' 
  AND (
    token = 'hNmgqlHLi5c3z5Ia09+UYgN69QzwnWZwLtTstQclHjw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038