UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'df/qwdcr+lFpQWLGV8Sxf/2y6tDBvOJu0IeVbf61sIw=' 
WHERE 
  key_id = 'a31b1eed872e522df4143ce139dbaf3d9e1347adc686b1a80dd89a0669e3f3ea' 
  AND (
    token = 'df/qwdcr+lFpQWLGV8Sxf/2y6tDBvOJu0IeVbf61sIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029