UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LXWytMRfvUOxfF1nKokcTBYgXAV9p4umuPXPR3I8Hvs='
WHERE
key_id = '440a34cac9b5d0be8f726c1862c9ec6e244ad2b6accce49f18625a6071494fe3'
AND (
token = 'LXWytMRfvUOxfF1nKokcTBYgXAV9p4umuPXPR3I8Hvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)