UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iN7VDQ5a50g5JQZDUnzy/2ZJRvTFKv6qtz1eqg281iI=' 
WHERE 
  key_id = '12e19dbee834177fb6d7c91803b5a4ad62773fa0a6b517605eece5f8086a8462' 
  AND (
    token = 'iN7VDQ5a50g5JQZDUnzy/2ZJRvTFKv6qtz1eqg281iI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051