UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+DcGWfOa04Yldivej0bSTWSZVD8DTJl0OTPsRPMvwSA=' 
WHERE 
  key_id = '60a540e0527e212704b9ce5de270b89d887275ec8841122104e2437b9eeb7e40' 
  AND (
    token = '+DcGWfOa04Yldivej0bSTWSZVD8DTJl0OTPsRPMvwSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041