UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '22Q4dTzSZ07pAdg2ugxxaoSgiT0bYBB4dW7hOLvK4P0='
WHERE
key_id = '6571ad4f0e75a8ca835577c383059d00ae91a2e41c1bfd1132f99ca53b0e098e'
AND (
token = '22Q4dTzSZ07pAdg2ugxxaoSgiT0bYBB4dW7hOLvK4P0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)