UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Y+D22BLLhey4BciThJZP5zA+EDvXU7o2rtSKrfaNLI=' 
WHERE 
  key_id = 'c0db094b25c903f9c82d2dfbd38dec3340364cee2e2f13526af13f0f838563c6' 
  AND (
    token = '2Y+D22BLLhey4BciThJZP5zA+EDvXU7o2rtSKrfaNLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022