UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8iTs+hc8IZLKtKeTFYEksxB9z9sPk8UgBf14LVDeJPU='
WHERE
key_id = '385d4b326dba7e3c078f7e69960be49160dbfb4a7e1175bd25bf38155e3b7791'
AND (
token = '8iTs+hc8IZLKtKeTFYEksxB9z9sPk8UgBf14LVDeJPU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)