UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l6iJmfGqBOKSnmr/VqgUXkfhdasW46S9TSsZK8pA54w=' 
WHERE 
  key_id = '2c6a3ae39bc054fff405c238e2e28e58596d1c2ba096c46ba9e987daac0e7e5d' 
  AND (
    token = 'l6iJmfGqBOKSnmr/VqgUXkfhdasW46S9TSsZK8pA54w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067