UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44ozQXQONXQYbPdWR5iFqWdxrU4dh1KSyypBKZPkyOk='
WHERE
key_id = 'c4396e1d027205398927a074ecbcd036142cd328d58ae324e15f3232dfeccea6'
AND (
token = '44ozQXQONXQYbPdWR5iFqWdxrU4dh1KSyypBKZPkyOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)