UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w+mxRnOWpwEOvvxNqhsHmS7mLxMYCGmrBuvQvFnKaH0=' 
WHERE 
  key_id = 'c2c8988c37e25fd1383244b50f572cd6ae2cb9c677a5683f6730c30bf9eb2ea1' 
  AND (
    token = 'w+mxRnOWpwEOvvxNqhsHmS7mLxMYCGmrBuvQvFnKaH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030