UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sVqX0sqPC1C+g/Xw4vkv1ngabOt1hXycm0ockxt6UUg=' 
WHERE 
  key_id = 'eca39ad7b2314271ad1e800ef70d12a49340b41f6d35c1624047f0d673632cec' 
  AND (
    token = 'sVqX0sqPC1C+g/Xw4vkv1ngabOt1hXycm0ockxt6UUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050