UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R+r32HjwFqWPOm3O99RLlMixp5eGW/e45HFHv96lvMo=' 
WHERE 
  key_id = 'c958dd383265bfa4f75a9799a2445b2635f7665fc72269cdf4e0e7896c4c40a4' 
  AND (
    token = 'R+r32HjwFqWPOm3O99RLlMixp5eGW/e45HFHv96lvMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042