UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GQHBuTTOBaFYBk4ujUQ6px+lg1fhyX/qsO94mPdJMSA=' 
WHERE 
  key_id = '7d0511153e64f8ec3e30dce7406ae3a42c5a6e38c4c98f2cd6caa7b713ba6677' 
  AND (
    token = 'GQHBuTTOBaFYBk4ujUQ6px+lg1fhyX/qsO94mPdJMSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033