UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wbG+CI9SdFrQIbGEglBsh444jfmpDO9fnuwyODvE19c='
WHERE
key_id = 'aebd4c7b29ca088a9a46d9aa749118ef91989cabc2c93ece54c9215d519553a7'
AND (
token = 'wbG+CI9SdFrQIbGEglBsh444jfmpDO9fnuwyODvE19c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)