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

Query time 0.00033