UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zGLQPnhJNrhN29rW96WD2bfGBt5OCWFjF6lg+Hk7Cu8=' 
WHERE 
  key_id = 'e3eb1d5f62599479d1c974a606591aa86f83db91f84d2ee99d4f6d463904bb9c' 
  AND (
    token = 'zGLQPnhJNrhN29rW96WD2bfGBt5OCWFjF6lg+Hk7Cu8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037