UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wlpz1KdnHloaSn5I71MfQ+X6oGlQZ6GJcsktpRpH53U='
WHERE
key_id = 'a04dc6a6dab67469c41bd0b323d96f7f6d8e3fbbb4cfbbdcde0be9672f8043a9'
AND (
token = 'wlpz1KdnHloaSn5I71MfQ+X6oGlQZ6GJcsktpRpH53U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)