UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RROxZ9ev3D3Bgu1xn8UecuQ2nG85f+4mwESzEuF5HMM=' 
WHERE 
  key_id = 'eb6cee18dd295bb36901ed5c8eca1adfec5f19c89d902fb782622666deb7a46a' 
  AND (
    token = 'RROxZ9ev3D3Bgu1xn8UecuQ2nG85f+4mwESzEuF5HMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032