UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NguDuye7NN3HzcKU1C1QE7l6NxPVOzEkBSbbF0gjRY='
WHERE
key_id = 'a15b6f9f763e645ccbd53a399dd4c629116db0cfee7cc8e2ee1f25fdad150f93'
AND (
token = '/NguDuye7NN3HzcKU1C1QE7l6NxPVOzEkBSbbF0gjRY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)