UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QrI9srfuc2T2xGU2O//YOiOMuBj0BYQ1bXNBYjez2oQ='
WHERE
key_id = '968384800ac7e5780732ab83a7d4f3e108059691737c2f089aa861c0efec37cf'
AND (
token = 'QrI9srfuc2T2xGU2O//YOiOMuBj0BYQ1bXNBYjez2oQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)