UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ttXbkynZ4N7Q7U2GCEnJTqhG0joCGgN+cmfTcyQI1s=' 
WHERE 
  key_id = '71d6c392861af072e053d05616c90746a878a3df7a0c9397df01c11e03c85803' 
  AND (
    token = '2ttXbkynZ4N7Q7U2GCEnJTqhG0joCGgN+cmfTcyQI1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036