UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nNFmw4SPFnsjzvkmbPdjsEbW6WkVy69O0p+PNat7buc=' 
WHERE 
  key_id = 'ce0d40b13833e7cde9ede5d59e5cd8b55d324220641aa55a4505db6b8968c096' 
  AND (
    token = 'nNFmw4SPFnsjzvkmbPdjsEbW6WkVy69O0p+PNat7buc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026