UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mcY683jmdjAhCn5z/LoqgLNSRVC+IfecHcdwAMl3V5U=' 
WHERE 
  key_id = '6726d6cbcd78cb0360e645ac128209da950e5f5d8769bf9c09a5a892f3cd2e78' 
  AND (
    token = 'mcY683jmdjAhCn5z/LoqgLNSRVC+IfecHcdwAMl3V5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034