UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CpBCv9B4HKM+GXiOmnFrEOx6OU2NSwxaRSGGOJNY7MM=' 
WHERE 
  key_id = 'a5b0a6fc1df2c7ecffefac9e9ec46b95972db1ed4eabd95d189947823ea8f9c4' 
  AND (
    token = 'CpBCv9B4HKM+GXiOmnFrEOx6OU2NSwxaRSGGOJNY7MM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016