UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KPqHIOAg2k0sD7UhmZfTjSrKAYllbVtQDsET/t2cAkI='
WHERE
key_id = '37546bed533d62c89c7834d95f02a2b03a54af7b066d06f431777f05546be309'
AND (
token = 'KPqHIOAg2k0sD7UhmZfTjSrKAYllbVtQDsET/t2cAkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)