UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OChYNnWnqAUq88EDl+VuW9Dmi/vESxoJaWALpRWDKfU=' 
WHERE 
  key_id = '1f296236e10da1f4d0f8339b5bd51985e5c99130f4276808667099a2c37eabee' 
  AND (
    token = 'OChYNnWnqAUq88EDl+VuW9Dmi/vESxoJaWALpRWDKfU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030