UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VwkqJZyK++rLhcszlHGjDc5Hn/5CKMaxDwZrsG4x9Dg=' 
WHERE 
  key_id = '16924b886db0e7969d7fcc8647cd8436795ddf23b1f93967932279ea7ae03af4' 
  AND (
    token = 'VwkqJZyK++rLhcszlHGjDc5Hn/5CKMaxDwZrsG4x9Dg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034