UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ziv3AdYhksuk3ZxRzkwGNRJnbAKpvkIzi+WVyqAMlM='
WHERE
key_id = 'f1092dc00fabc7bd07a89daede1ddda7df0685cf858f996c47703e3d64f528ce'
AND (
token = '6ziv3AdYhksuk3ZxRzkwGNRJnbAKpvkIzi+WVyqAMlM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)