UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EsgvaWiLc9fWjqFA782+AQkTqGD0kyFyZgh0FRijung='
WHERE
key_id = '226d30ce85985376501f56c76457ffcada6f92738b736073366ca868ef33495c'
AND (
token = 'EsgvaWiLc9fWjqFA782+AQkTqGD0kyFyZgh0FRijung='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)