UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DyEGyyiW9JbzGHV96eCHnaTcDEN38pIxibK/P2XwX+I='
WHERE
key_id = '001f919d784e853f625297d10dbdd604f18ce8fc3798ea9304ac0653ef0bcfe2'
AND (
token = 'DyEGyyiW9JbzGHV96eCHnaTcDEN38pIxibK/P2XwX+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)