UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uH+Epmo09Whpg4pj5FJA7BXfcQWrOKyvmosxtrzmAYQ=' 
WHERE 
  key_id = '79f458552be8d93bb5b61890aa8ede29e44bc1df1b064a8952beee4771635ca0' 
  AND (
    token = 'uH+Epmo09Whpg4pj5FJA7BXfcQWrOKyvmosxtrzmAYQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045