UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NOBoek/Lh+kOe2Srq2FUuTOcwCJtUqDfgh/DPeJvNFY=' 
WHERE 
  key_id = '554225d57eb2a475bd2c96a0250bdbb85e86e70a3be6c5260b950f2d50688c4b' 
  AND (
    token = 'NOBoek/Lh+kOe2Srq2FUuTOcwCJtUqDfgh/DPeJvNFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019