UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ii9VNZakdhsWKnOdRKnDlPSXUVdvjBXAnSHlD1AiX08='
WHERE
key_id = '72145f053fc3916b3da2813ec20cc6c16d27175deac0183baae2efc09b2142b9'
AND (
token = 'ii9VNZakdhsWKnOdRKnDlPSXUVdvjBXAnSHlD1AiX08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)