UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'crRS/vY0uYVkVqTVJsKZ5oMHi8COR2igIEix6MkbJcw=' 
WHERE 
  key_id = 'b675cc0aa73d9e55bdd88c057dfe7869910ebcacd09ec697e7309ae4fdca7eb2' 
  AND (
    token = 'crRS/vY0uYVkVqTVJsKZ5oMHi8COR2igIEix6MkbJcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040