UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OOwxzHXqTNS/7VKvEs6TEvuQ4r8LZQCwYgfQquiAexg='
WHERE
key_id = '37236aae7b5fd1e0702dd609ad009d4797f4102fe8abdbd54181e4e37340bd4a'
AND (
token = 'OOwxzHXqTNS/7VKvEs6TEvuQ4r8LZQCwYgfQquiAexg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)