UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Lv2kupbRFa6RUVcUAbdbzK8MYY+ETYtx0af2JdVblg=' 
WHERE 
  key_id = '99a93c6c6d70fc5d4f430f99d800a02e290e10b9fa17fe1546ff3faa59b519c5' 
  AND (
    token = '9Lv2kupbRFa6RUVcUAbdbzK8MYY+ETYtx0af2JdVblg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026