UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+uqNtRBFDHi34dOIkZDotUN3naeqaZuZDIIMfPvp/Ow=' 
WHERE 
  key_id = '2ad25553516e53b4361aaa274cde0dd44ff7916ff26bf73f9606e4e52102dcb2' 
  AND (
    token = '+uqNtRBFDHi34dOIkZDotUN3naeqaZuZDIIMfPvp/Ow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035