UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Zp7mgRCYUuKQA5ArGiAGUzEMgJpwCSQgVN5ZMHEK7I='
WHERE
key_id = '2e9fdcaf893e5eda9fe575f997a587d188ed4f6df731a21ddc87723d302562c8'
AND (
token = '9Zp7mgRCYUuKQA5ArGiAGUzEMgJpwCSQgVN5ZMHEK7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)