UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I6wc/pt6D4Fj1z9K/8Uos9U6lKgoVFU93uKx625vRqU=' 
WHERE 
  key_id = '9e6c79434bb11b54e937f04ba990dafec80f438e404909f03bebfde9920f9fc5' 
  AND (
    token = 'I6wc/pt6D4Fj1z9K/8Uos9U6lKgoVFU93uKx625vRqU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025