UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UiHSiHMmMfMIAfFBTmVxtTgDFwE2Xt+yJ3YWJ++5F/U=' 
WHERE 
  key_id = 'd25d2e415822d6c3b7d66eafd5d268589a05ef941d8fd9cdf9cb54737229e421' 
  AND (
    token = 'UiHSiHMmMfMIAfFBTmVxtTgDFwE2Xt+yJ3YWJ++5F/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031