UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7c5j//+vLioBOvAp+88bEpCZMDye8PVml+nIswL0dQY=' 
WHERE 
  key_id = 'd52d2d71972586f1c20d5e455ebb7d87ec7110ff7234bf6609b41564e65608c8' 
  AND (
    token = '7c5j//+vLioBOvAp+88bEpCZMDye8PVml+nIswL0dQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036