UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vgJUihM4ZhYhH+mKlepptF0ztL3/Ou1I/23BjX181NA=' 
WHERE 
  key_id = '7ac2d45c3036c69da6f30be2fdfc527fc0ac8db74bd7a1b66c8cb9db671b61d4' 
  AND (
    token = 'vgJUihM4ZhYhH+mKlepptF0ztL3/Ou1I/23BjX181NA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00140