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

Query time 0.00036