UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jtg/VDmg8symTUjCwZQAIXX8d0CKg89zU3P5u3K1xBw=' 
WHERE 
  key_id = '1c8407e96800607fac2b9cc647ad00059a0216a1f0c454e292f9322c391bc289' 
  AND (
    token = 'Jtg/VDmg8symTUjCwZQAIXX8d0CKg89zU3P5u3K1xBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032