UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sz35027Le61lov3gmtHXfsDGTPdIpaj1TxX6Uoli8Yw='
WHERE
key_id = '3591b34b580917640b82b5c445370279e2a8fdfdb8d045fba19c5fd82c878d4e'
AND (
token = 'sz35027Le61lov3gmtHXfsDGTPdIpaj1TxX6Uoli8Yw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)