UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D1oZ9COu8tbMfvCMYTfClycuYDbfTtp4Wm9aFnvs2dE='
WHERE
key_id = '6539a7d3e7a81b6ca949ca9f7cd4551727b60558e8b2627949983e9e03f3eeb3'
AND (
token = 'D1oZ9COu8tbMfvCMYTfClycuYDbfTtp4Wm9aFnvs2dE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)