UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5wXJuhsLGkl4YPz/8LGYo4k8Gk1xgPyYg6bXazAh/Q='
WHERE
key_id = 'f63cd541948861bb1eba574524b0594a1dab3a18b1cb24e3a63fa47dd86754af'
AND (
token = 'k5wXJuhsLGkl4YPz/8LGYo4k8Gk1xgPyYg6bXazAh/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)