UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7dhLQjYV//5E7UFgKXG/OJVI4g+GqRuPO0x6PRcD9fE=' 
WHERE 
  key_id = 'cc95250144604e828b3f238b8877ff1db8a8954cf1078fdbb33c464fbf5bea64' 
  AND (
    token = '7dhLQjYV//5E7UFgKXG/OJVI4g+GqRuPO0x6PRcD9fE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025