UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gNlSkfoyV6LLluqOWWJisOzBwXUnOadxbEC4pY87qEg=' 
WHERE 
  key_id = 'ce8616a5cbe492ff0b7916c4911fedb42b75499ffd194087bf0d5ca1c51a9e83' 
  AND (
    token = 'gNlSkfoyV6LLluqOWWJisOzBwXUnOadxbEC4pY87qEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029