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

Query time 0.00040