UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6zF2gQws93O+hYutU8TxJtwWNYKyAdTIf6OmglwnW2U=' 
WHERE 
  key_id = 'a8276bd1d15f69045ec30074c92cb26d8904a090e2ecf366c932e084ac7fc940' 
  AND (
    token = '6zF2gQws93O+hYutU8TxJtwWNYKyAdTIf6OmglwnW2U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029