UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4LexXf1rwU2jUXSqLvh728XJXXRam+hAV1ZAOJR/4UU='
WHERE
key_id = 'cb1ed0d11b28fc068e0c682023bda7c62557d8dd8b1f1ae4cd6aa12b215e01a7'
AND (
token = '4LexXf1rwU2jUXSqLvh728XJXXRam+hAV1ZAOJR/4UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)