UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8wm46g3ie6A0OP5j1Ghh9MaYUlJqb6pbjuWfAk2DCi8='
WHERE
key_id = '928aead02412b904b20bc7ae398b1a04701aa879012cb5a344976ce62664edf9'
AND (
token = '8wm46g3ie6A0OP5j1Ghh9MaYUlJqb6pbjuWfAk2DCi8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)