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