UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EtwYvcPin/4sMbqNL+2FC0JxrtYiKcYfBVDB27DY1Kc='
WHERE
key_id = '86bf95857671e6f9249a4cda82b6b7feedf92846409f6caabb7908a1627b2d11'
AND (
token = 'EtwYvcPin/4sMbqNL+2FC0JxrtYiKcYfBVDB27DY1Kc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)