UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CPNv7OtJc1IwsHFITcomkSHk1UubwABiCVqtQxFutuk='
WHERE
key_id = '08ee32afc62d68709222b0024d8adc14e3afb82afaa8a02740f31ea59e5321c5'
AND (
token = 'CPNv7OtJc1IwsHFITcomkSHk1UubwABiCVqtQxFutuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)