UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AVe7L5FhumlEhPvpVCmBJRvxZIDjHDCxnhScim2Z6Pw=' 
WHERE 
  key_id = 'ff7b032104eaa53a6dcc854b63ffe5141fe9863c7464e3bf281e2a1d32f5759c' 
  AND (
    token = 'AVe7L5FhumlEhPvpVCmBJRvxZIDjHDCxnhScim2Z6Pw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026