UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Cz8nWE0KtED3xIJclNxGR9OpWqp18CZUiGWeQLWR7I='
WHERE
key_id = '6e38a85080656067d078f7ff4bc445807507d706c5c430b8b919e3d771de6249'
AND (
token = '3Cz8nWE0KtED3xIJclNxGR9OpWqp18CZUiGWeQLWR7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)