UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8EmKFsXVEC2R9OgpublixTYW4g6F97mxCUlYeqXyYgQ='
WHERE
key_id = '6c9820dd5cbcf5f8aca89b55dd8eae9210b22548c6a8590f2bb3be1729144347'
AND (
token = '8EmKFsXVEC2R9OgpublixTYW4g6F97mxCUlYeqXyYgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)