UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TGkm8/XBPlODh/imxncHrbUSpweLcCePdFBINjjo4Y8=' 
WHERE 
  key_id = '31997ec213b9c883dd696f2ae03b9c446e9a3c631c451df63f42cc572518fa65' 
  AND (
    token = 'TGkm8/XBPlODh/imxncHrbUSpweLcCePdFBINjjo4Y8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017