UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JrpQz+FmR41Qj8GXAA6rMdcfleuoCE2QeowpUvGrwk0=' 
WHERE 
  key_id = '705c847cbaa59eff63829d1b6950e36571e37a70a3bd1f71dfbee7396fc4bc85' 
  AND (
    token = 'JrpQz+FmR41Qj8GXAA6rMdcfleuoCE2QeowpUvGrwk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049