UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VAqrs6Rh5etkGymTG8YMN0daoGh8NvG7yqtc/8sAvvk='
WHERE
key_id = 'eff61d81ceac5e002d38dd97b9fb5ea4465bcec4c309c2c2d2e93488e765df9c'
AND (
token = 'VAqrs6Rh5etkGymTG8YMN0daoGh8NvG7yqtc/8sAvvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)